.class Lcom/burstly/lib/util/calendar/CalendarEventValidator;
.super Ljava/lang/Object;
.source "CalendarEventValidator.java"


# static fields
.field private static final LOG:Lcom/burstly/lib/util/LoggerExt;

.field private static final TAG:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 31
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/util/calendar/CalendarEventValidator;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 36
    const-class v0, Lcom/burstly/lib/util/calendar/CalendarEventValidator;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/util/calendar/CalendarEventValidator;->TAG:Ljava/lang/String;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .prologue
    .line 41
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 42
    return-void
.end method

.method static validateCalendarEvent(Lcom/burstly/lib/util/calendar/CalendarEvent;)V
    .locals 4
    .parameter "event"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    .line 51
    const-string v0, "Event can not be null"

    invoke-static {p0, v0}, Lcom/burstly/lib/util/Utils;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 52
    iget-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->start:Ljava/lang/Long;

    const-string v1, "Event\'s start date can not be null"

    invoke-static {v0, v1}, Lcom/burstly/lib/util/Utils;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 53
    iget-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->end:Ljava/lang/Long;

    const-string v1, "Event\'s end date can not be null"

    invoke-static {v0, v1}, Lcom/burstly/lib/util/Utils;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 54
    iget-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->description:Ljava/lang/String;

    const-string v1, "Event\'s description can not be null"

    invoke-static {v0, v1}, Lcom/burstly/lib/util/Utils;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 55
    iget-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->reminder:Ljava/lang/String;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->reminder:Ljava/lang/String;

    const-string v1, "-"

    invoke-virtual {v0, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 56
    sget-object v0, Lcom/burstly/lib/util/calendar/CalendarEventValidator;->LOG:Lcom/burstly/lib/util/LoggerExt;

    sget-object v1, Lcom/burstly/lib/util/calendar/CalendarEventValidator;->TAG:Ljava/lang/String;

    const-string v2, "Specific remind date is not supported. Use negative form (for ex. -3600000) to notify an hour before the event."

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Object;

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 58
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->reminder:Ljava/lang/String;

    .line 60
    :cond_0
    iget-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->recurrence:Lcom/burstly/lib/util/calendar/EventRepeatRule;

    if-nez v0, :cond_1

    .line 61
    iget-object v0, p0, Lcom/burstly/lib/util/calendar/CalendarEvent;->end:Ljava/lang/Long;

    const-string v1, "End date must be set for non-recurring events."

    invoke-static {v0, v1}, Lcom/burstly/lib/util/Utils;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 63
    :cond_1
    return-void
.end method
